import {
  msg
} from '../../tools/msg';

export const msgTest = {
  msgTimer() {
    wx.cloud.callFunction({
      name: 'msgTimer'
    }).then(res => {
      console.log(res)
    })
  },
  sendSmsTc() {
    wx.cloud.callFunction({
      name: 'sendSmsTc',
      data: {
        templateName: "custom_msg",
        templateParamList: ["7月12日14:25", "4"],
        phoneNumberList: ["+8613185358006"],
        sessionContext: 'this a test'
      }
    }).then(res => {
      console.log(res)
    })
  },
  async sendSms() {
    const r = await wx.cloud.callFunction({
      name: 'sendSms',
      data: {
        content, // '您有新的客户消息，请及时回复',
        phoneNumberList: ["+86" + user.phoneNumber], // ["+8617719888583", "+8613185358006", "+8615078863852"],
        path: '/index.html' // 静态网站部署的页面
      }
    })
  },
  notifyDelivery() {
    wx.cloud.callFunction({
      name: 'notifyDelivery',
      data: {
        orderId: '6d35026063e73e9600005027696b0099'
      }
    }).then(res => {
      console.log(res)
    })
  },
  notifyDeliveryMan() {
    msg.notifyDeliveryMan("820c1c8b64b3f14f0009ad2400ea2cb1", "15278aae64933d90000056d863df13ed", res => {
      console.log(res)
    })
  },
  peekNewMsg() {
    wx.cloud.callFunction({
      name: 'chatCmd',
      data: {
        cmd: 'peekNewMsg',
        userOpenId: 'ohAbj5Wmml_Oq40ZtldqaTZ5Sqfk' // Way
      }
    }).then(res => {
      console.log(res)
    })
  }
}